﻿namespace Yom.Data
{
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;

    public class Setting
    {
        #region 私有成员定义
        private readonly DBHelper db = new DBHelper();
        #endregion

        #region 构造函数
        public Setting() { }
        #endregion

        #region 公共方法
        /// <summary>
        /// 操作配置
        /// 
        /// 创建: 邱柯皓 2009/02/10 17:04
        /// </summary>
        /// <param name="strSQL">查询语句</param>
        /// <returns>返回成功标识</returns>
        public bool Query(string strSQL)
        {
            return db.ExecuteNonQuery(CommandType.Text, strSQL, null) > 0;
        }

        /// <summary>
        /// 获取配置
        /// 
        /// 创建: 邱柯皓 2009/02/10 17:05
        /// </summary>
        /// <returns>返回配置信息</returns>
        public SqlDataReader GetSet()
        {
            SqlDataReader dr = db.ExecuteReader(CommandType.Text, "SELECT * FROM [Yom_Setting] WHERE [SetID]=1", null);
            return dr;
        }
        #endregion
    }
}